<include file="Public:head"/>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="ibox float-e-margins">
		<div class="ibox-title">
			<h5>管理员列表</h5>
			<div class="ibox-tools" style="margin-top: -9px;">
				<a href="javascript:location.reload();" class="btn btn-primary"><i class="fa fa-refresh"></i> 刷新</a>
			</div>
		</div>
		<div class="ibox-content">
			<div class="row row-lg">
				<div class="col-sm-12">
					<!--<h4 class="example-title"></h4>-->
					<a class="btn btn-primary" href="{:url('admin/add')}">添加管理员</a>
					<br/>
					<div class="table-responsive">
						<!--class="table table-bordered table-hover"-->
						<table data-toggle="table" class="table table-bordered table-hover"
							  >
							<thead>
							<tr  style="background: #f9f9f9;">
								<th>管理员编号</th>
								<th>管理员账号</th>
								<th>管理员上次登陆时间</th>
								<th>管理员上次登陆Ip</th>
								<th>管理员姓名</th>
								<th>管理员联系电话</th>
								<th>管理员联系地址</th>
								<th>操作</th>
							</tr>
							</thead>
							<tbody>
							<volist name="data" id="vo">
								<tr>
									<td>{$vo['id']}</td>
									<td>{$vo.account}</td>
									<td>{$vo.logintime|date="Y-m-d H:i:s",###}</td>
									<td>{$vo.loginip}</td>
									<td>{$vo.real_name}</td>
									<td>{$vo.phone}</td>
									<td>{$vo.address}</td>
									<td>
										<a href="{:url('Admin/edit',array('id'=>$vo['id']))}" class="btn btn-primary">编辑</a>
										<a href="{:url('Admin/ban',array('id'=>$vo['id']))}" class="btn btn-primary"><eq name="vo.staus" value="0">恢复正常<else/>禁止登录</eq></a>
										<a  href="javascript:;" data-id="{$vo.id}"  class="btn btn-danger" >删除</a>
									</td>
								</tr>
							</volist>
							</tbody>
						</table>
					</div>
				</div>
				<div class="col-sm-12">
					<!-- Example Pagination -->
					<ul class="pagination  pull-right">
						{$page}
					</ul>
					<!-- End Example Pagination -->
				</div>
			</div>
		</div>
	</div>
	<!-- End Panel Basic -->
</div>

<!-- 全局js -->
<script src="__STATIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script>
	//删除管理员
	$(".btn-danger").click(function(){
		var id = $(this).attr('data-id');
		parent.layer.confirm('删除数据无法恢复，并且会影响用户数据，确定删除？', {
			shade:false,
			btn: ['确定', '取消']
		}, function() {
			$.post("{:url('Admin/del')}", {id: id}, function (result) {
				if (result.code == '0') {
					parent.layer.alert(result.msg);
				} else {
					parent.layer.msg(result.msg, {
								icon:1
							},
							function (index, item) {
//								parent.layer.close(index);
								location.reload();
							});
				}
			});
		});
	})
</script>
</body>

</html>
